<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        body{
            cursor: pointer;
        }
        
        img{
            position: absolute;
            top: 2px;
            left: 2px;
        }
    </style>
</head>
<body>
    <img src="./images/angel.gif" alt="">

    <script>
        // 实时获取鼠标的位置 
        // mousemove 事件  

        // 给整个文档绑定鼠标移动事件  
        // 通过事件对象获取鼠标实时的位置
        // pagex  pagey 
        var angle = document.querySelector('img');

        document.addEventListener('mousemove',function(event){
                var e = event || window.event;
                var x = e.pageX;
                var y = e.pageY;
                console.log(x,y);
                angle.style.left = x-40 + 'px';
                angle.style.top = y-30 + 'px';

        });

        docu
    </script>
</body>
</html>